package vis;

import java.awt.Color;
import java.awt.Graphics2D;

import logic.PointD;

public class GPoint extends PointD implements Drawable {
	private Color color = Color.blue;
	private Color hlColor = Color.ORANGE;
	private boolean hl = false;
	private boolean visible = true;
	
	private static final int HLD = 5;
	private static final int ND = 3;
	
	public GPoint(double x, double y) {
		super(x, y);
	}
	
	public GPoint clone()
	{
		GPoint p = new GPoint(X, Y);
		p.parent = parent;
		p.color = color;
		p.hlColor = hlColor;
		p.hl = hl;
		p.visible = visible;
		p.meta1 = meta1;
		p.meta2 = meta2;
		p.meta3 = meta3;
		return p;
	}
	
	@Override
	public void draw(Graphics2D g) {
		if(hl)
		{
			g.setColor(hlColor);
			g.fillOval((int)X - HLD, (int)Y - HLD, HLD * 2, HLD * 2);
		}
		else
		{
			g.setColor(color);
			g.fillOval((int)X - ND, (int)Y - ND, ND * 2, ND * 2);
		}
	}

	@Override
	public Color getColor() {
		return color;
	}

	@Override
	public void resetHighlight() {
		hl = false;
	}

	@Override
	public void setColor(Color c) {
		color = c;
	}

	@Override
	public void setHighlight(Color c) {
		hlColor = c;
		hl = true;
	}

	@Override
	public boolean isVisible() {
		return visible;
	}

	@Override
	public void setVisible(boolean vis) {
		visible = vis;
	}
	
	@Override
	public void setPosition(double x, double y)
	{
		this.X = x;
		this.Y = y;
	}

	@Override
	public double getPosX() {
		return X;
	}

	@Override
	public double getPosY() {
		return Y;
	}
	
	@Override
	public Color getHighlightColor() {
		return hlColor;
	}

	@Override
	public boolean isHighlighted() {
		return hl;
	}


}
